package org.chen.bas.util;


import com.baidu.aip.contentcensor.AipContentCensor;
import com.baidu.aip.contentcensor.EImgType;
import org.json.JSONObject;
public class Sample {
    //设置APPID/AK/SK
    public static final String APP_ID ="78965239";
    public static final String API_KEY = "xF0N3lNluqnXHOyIsales80r";
    public static final String SECRET_KEY = "5yLSqdJd33N1h4KDm8u1kZVC9jgQ6hmi";

    public static void main(String[] args) throws Exception{
        // 初始化一个AipContentCensor
        AipContentCensor client = new AipContentCensor(APP_ID, API_KEY, SECRET_KEY);

        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);

        // 调用接口
        String path = "D:\\Java\\u=1540170495,3975076905&fm=253&fmt=auto&app=120&f=JPEG.webp";
        JSONObject res = client.imageCensorUserDefined(path, EImgType.FILE, null);
        System.out.println(res.toString());

    }
}